<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: LQ
  Date: 2021/5/19
  Time: 19:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="/jQuery/jquery-3.4.1.min.js"></script>
</head>
<body>
<div>
    <jsp:include page="main.jsp"/>
</div>
<div style="margin-left: 30%;margin-top: 1%">
    <h2>评论管理</h2>
    <table border="1px">
        <tr>
            <td>文章标题</td>
            <td>评论用户</td>
            <td>评论内容</td>
            <td>评论时间</td>
            <td>操作</td>
        </tr>

        <c:forEach items="${requestScope.commentList}" var="comment">
            <tr>
                <td><a href="/preview?aId=${comment.article.articleId}">${comment.article.articleName}</a></td>
                <td>${comment.user.userName}</td>
                <td>${comment.commentContent}</td>
                <td>${comment.commentInsertTime}</td>
                <td>
                    <form action="/deleteComment?cId=${comment.commentId}" method="post">
                        <button>删除</button>
                    </form>
                </td>
            </tr>
        </c:forEach>
    </table>

</div>
</body>
</html>
